﻿@model DomainModel.Entities.Company

@{
    ViewBag.Title = "Edit " + Model.Name;
}

<h2>@ViewBag.Title</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Company</legend>

        @Html.HiddenFor(model => model.CompanyId)

       
        <div class="editor-field">
            @Html.EditorFor(model => model.LastUpdate)
            @Html.ValidationMessageFor(model => model.LastUpdate)
        </div>

       
        <div class="editor-field">
            @Html.EditorFor(model => model.IsApproved)
            @Html.ValidationMessageFor(model => model.IsApproved)
        </div>

        <div class="editor-field">
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name_Ar)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name_Ar)
            @Html.ValidationMessageFor(model => model.Name_Ar)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Phone)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Phone)
            @Html.ValidationMessageFor(model => model.Phone)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Address)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Address)
            @Html.ValidationMessageFor(model => model.Address)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Address_Ar)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Address_Ar)
            @Html.ValidationMessageFor(model => model.Address_Ar)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Website)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Website)
            @Html.ValidationMessageFor(model => model.Website)
        </div>

      <div class="editor-label">
            @Html.LabelFor(model => model.TypeId) (@Html.ActionLink("Not present add new", "Create", "CompanyType", null, null))
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(ct => ct.TypeId, new SelectList(ViewBag.CompanyTypes as System.Collections.IEnumerable, "TypeId", "Name"))
           @Html.ValidationMessageFor(model => model.TypeId)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
